/*
    created: 2023/4/11
    filename: Main.c
    author: 李东霖
    purpose：使用链表实现栈 带头结点 对链栈操作进行测试 

*/

#include"liststack.h"
int main()
{
    PListStack s = InitStack2();
    printf("length = %d \n",LengthStack(s));

    for(int i = 0; i != 5;++i)
    {
        Push(s,&i);
    }
    DispStack(s);
    printf("\n");
    ElemType elem = 100;
    Push(s,&elem);
    DispStack(s);
    printf("\n");
    elem = 0;
    Pop(s,&elem);
    printf("pop elem = %d  \n",elem);
    printf("length = %d \n",LengthStack(s));
    ClearStack(s);
    Push(s,&elem);
    elem = 0;
    GetTop(s,&elem);
    printf("top elem = %d  \n",elem);
    DispStack(s);

}